home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
Graphics
/
PostScript
/
Scott
/
stretch.ps
< prev
next >
Wrap
Text File
|
1995-06-12
|
3KB
|
110 lines
%% stretch.ps
%%
%% Written April 29, 1990,
%% Scott Hess
%% NeXT Campus Consultant
%% Gustavus Adolphus College
%% St. Peter, Mn 56082
%% scott@gacvax1.bitnet
%%
%% This program is a _slight_ modification of the melt program. Can you find
%% the change? No fair using an automated utility!
%% This file may be installed so that the Scene application will bring it up
%% under the Movies menu. To do this, create a directory within the
%% /NextLibrary/Images/Scene_movies directory named stretch.movie. Inside this
%% directory, place this file, with the name stretch.script.ps. Then, run
%% Scene, and there you are. This really belongs in the /LocalLibrary
%% directory, but unfortunately, Scene will not find it there. Sad, eh?
%% This code is freely released into the public domain. You may cut/paste,
%% slash, rearrange, remove comments, and otherwise mutilate this code
%% with no fear of reprisal from myself. So, go ahead! I want to see more
%% screen hacks, people!
%% scott
%% Grab the Workspace and draw it in the passed window.
/getWorkspace % window
{
gstate /dest exch def
/tempwin 0 0 1120 832 Nonretained window def
tempwin windowdeviceround
/tgs gstate def
false tempwin setautofill
Above 0 currentwindow orderwindow
dest setgstate 0 0 1120 832 tgs 0 0 Copy composite
tempwin termwindow
} def
%% Move a region of the current gstate.
/shift %% x y w h dx dy
{
4 index add
exch 5 index add
exch
gstate
3 1 roll
Copy composite
} def
%% Return after mouseclick accepted.
/waitmouse
{
{ buttondown {exit} if} loop
{ stilldown not {exit} if} loop
} def
%% return a random number between the 0 and the integer passed -1.
%% (ie, 100 rand returns from the range 0..99).
/random
{
rand exch mod
} def
gsave
%% get a window the size of the Workspace.
/win 0 0 1120 832 Buffered window def
win windowdeviceround
currentwindow getWorkspace
%% Move the psuedo-Workspace to the front.
Above 0 win orderwindow
%% How fast to drop. Not really needed, now.
/dropby 1 def
0.0 setgray %% leave behind Black
{
/width 1100 random 20 add def %% get a width from 20..1119
/height 416 random 416 add def %% drop at least half the screen.
/x 1120 width add random width sub def
x 0 lt { width x add /x 0 def} if %% constrain x to screen.
/drop dropby random 1 add def %% how much to drop?
x 0 width height 0 drop neg shift %% move it.
flushgraphics
buttondown {exit} if %% get out of here if buttondown
}
loop
waitmouse %% wait for that buttondown.
win termwindow %% get rid of the window.
grestore
Gustavus Adolphus College
%% St. Peter, Mn 56082
%% scott@gacvax1.bitnet
%%
%% This program is a _slight_ modification of the melt program. Can you find
%% the change? No fair using an automated utility!
%% This file may be installed so that the Scene application will bring it up
%% under the Movies menu. To do this, create a directory within the
%% /NextLibrary/Images/Scene_movies directory named stretch.movie.